package com.colin.juc.threadpool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by Colin on 2020/4/4 13:31
 * email: colinzhaodong@gmail.com
 * desc: //todo
 *
 * @author zhaod
 */
public class FixedThreadPoolOOM {
	private static ExecutorService executorService = Executors.newFixedThreadPool(1);
	public static void main(String[] args) {
		for (int i = 0; i < Integer.MAX_VALUE; i++) {
			executorService.execute(new SubThread());
		}
	}
}

class SubThread implements Runnable {


	@Override
	public void run() {
		try {
			Thread.sleep(1000000000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
